package cn.wolfcode.trip.base.service.impl;

import cn.wolfcode.trip.base.domain.StrategyTravel;
import cn.wolfcode.trip.base.domain.Travel;
import cn.wolfcode.trip.base.mapper.StrategyTravelMapper;
import cn.wolfcode.trip.base.service.IStrategyTravelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class StrategyTravelServiceImpl implements IStrategyTravelService {
    @Autowired
    private StrategyTravelMapper strategyTravelMapper;
    @Override
    public void insertRelation(StrategyTravel st) {
        st.setCreateTime(new Date());
        strategyTravelMapper.insert(st);
    }

    @Override
    public void deleteRelation(Long strategyId, Long travelId) {
        strategyTravelMapper.deleteRelation(strategyId,travelId);
    }

    @Override
    public List<Travel> queryTravelsByStrategyId(Long strategyId) {
        return strategyTravelMapper.selectTravelsByStrategyId(strategyId);
    }
}
